Repository navigation
feat: tool approval for agents: settings and grants on an agent's tools, migrate hop to agent chart 3.0 - #483
Conversation
Render spec.approval on the chart's MCPServer from muster.mcpServer.approval, with the "Allow all" preset: rule Allow and every tool of this release named Allow. These are the platform's own management servers, called by the Dev Portal as the signed-in person; agent callers are asked by muster's floors and the governance mode. An installation tightens a tool in its values (Ask or Block).
Helm merges an empty map into the chart's default, so only null renders no spec.approval.
A grant is a connector admin's Allow over that connector's Ask for one entry of one agent's tool list. The records live in a versioned ConfigMap per agent in agent-manager's namespace, written with its ServiceAccount, behind a Store interface a later connector manager can take over.
muster.toolApproval.enabled mounts agent-manager's projected ServiceAccount token (audience muster), passes the muster MCP URL and the grants namespace, grants ConfigMaps in the release namespace and, with downstream OAuth, get on HelmReleases in the managed namespaces. The connector approval map names the new tools.
…nd grants Agents carry a tool list (tools, default) with Allow, Ask or Block per entry, written where the agent chart takes it. update_agent changes what an agent is, update_agent_access what it can reach, set_agent_approval its settings: the only tool that grants an Allow over a connector's Ask, after a connector-admin check per connector, checked against muster's filter_tools. Every save drops the grants the saver is no connector admin of (an agent's save keeps none), a grant written before a values change past agent-manager no longer holds, and dropped grants leave running sessions. Session binds carry the agent, its settings and live grant marks with the approval sender token. list_approval_grants lists grants.
…nc and name the tools a grant covers A grants record whose object name, labels or agent disagree, or that does not decode, is skipped and logged instead of trusted or failing the whole listing. A record carries pendingSessionSync until muster confirmed the grants left, and is kept without grants for it. A grant records the server's own names of the tools it covered.
…own namespace muster.toolApproval.enabled defaults to true, so settings are never accepted where nothing binds them. The grants live in a namespace that holds nothing else (muster.toolApproval.grantsNamespace, created by the chart unless createGrantsNamespace is off); the ServiceAccount's ConfigMap Role reaches that namespace only.
…ch running sessions - get_agent and list_agents keep tools as the kagent MCP bindings; the tool list is toolSettings. - Settings are refused where agent-manager does not bind them; a session start is refused when settings cannot be bound (no sender, valuesFrom, missing release of a HelmRelease-managed agent, muster not taking them), and a muster without approval settings binds agents without them. - Grant drops are retried, marked pending and sent again on the agent's next start, save or read; delete_agent drops the agent's marks; results report sessionsUpdated and warnings. - Grants and their marks name the tools they cover; the toolset bound with settings is the release's own list. - set_agent_approval refuses a list that moved while it checked; a start never drops a newer grant; the release's chart version decides tools. - The split tools refuse undeclared arguments, connector-admin needs the caller's own identity, URL credentials are refused and redacted, grantedBy names a verified email, and the bindings client follows no redirect and binds up to 64 KiB.
get_agent and list_agents report approvalEnforced: whether the agent's settings are bound to its sessions. list_approval_grants takes namespace as optional: without it every managed namespace the caller may list HelmReleases in, the others named in unreadable; each grant carries agentDisplayName. set_agent_approval names its list toolSettings and defaultApproval, as get_agent does.
get_agent and list_agents report the release generation; update_agent, update_agent_access, set_agent_approval and REST PATCH take it as expectedGeneration and refuse a write when the release moved since, checked against the live release. Grant drops that never reached muster are swept once at start with the sender token alone, which muster accepts without a person's bearer; the bindings client sends a drop that way wherever no person's token is at hand.
…ganizations and spare recreated agents' marks - A Session start reads the agent's release as the caller where agent-manager's ServiceAccount may not (an organization namespace) and is refused only when neither may. - list_approval_grants without a namespace and the startup sweep cover the organization namespaces; an organization is never named in unreadable, only counted in unreadableCount when it failed for another reason. - A gone agent's pending record is sent with the grants of an agent recreated under the same name, so its marks are not dropped. - Unbind sends the approval sender token: muster deletes a sender-written binding only for it. - The service's Start runs the sweep; a bind's recheck compares marks with their tools.
…and trust a bindings CA - A create writes tools or toolset by the chart the namespace's agent chart source serves, so an organization's older source gets toolset and settings are refused naming it instead of a failed install. - get_agent, list_agents and create_agent report approvalEnforcement (enforced, not-enforced, pending) with approvalEnforced left out while the release has not run its current generation; a release without tools on an older chart is not-enforced. - delete_agent's result names the dropped grants; the session sync log carries muster's bindings and dropped counts. - list_approval_grants reviews list helmreleases before reading chart sources. - Plain http to muster is warned about only outside the cluster; an https bindings URL can trust a CA (--muster-bindings-ca-file, chart muster.bindingsCA).
…roval to default: Ask Agent chart 3.0 removes muster.requireApproval and the default of modelConfig.name. A target range on 3.x picks the new hop: requireApproval true becomes default: Ask where the muster binding renders, the key is dropped, and an unset modelConfig.name is written as default-model-config, what 2.x rendered. Each change is listed per release in the report and the log; a GitOps-owned release gets it as a diff. requireApproval true beside tool approval settings never rendered and fails the release. Both lines render the same Agent, so nothing is left to delete.
A Session bound with empty settings made muster ignore the agent's X-Muster-Tool-Approval header, so one running across the agent chart 3.0 upgrade, which drops kagent's flag, stopped asking. Such an agent's Sessions are now bound with default: Ask while its release carries the flag.
…ource, and report organization namespaces On the 2.x -> 3.x path a release with spec.valuesFrom is reported failed with what to change instead of having its model overwritten; a release whose source this run cannot move (pinned, owned by git, the platform's or an organization's) is held pending with the diff, since no released 2.x chart takes default. Organization namespaces are read and reported with diffs and keep the run pending; a run that may not list them fails. requireApproval null is dropped like false, and the report no longer lists a model it did not set. The hop's tests validate against the 3.0 chart's own schema.
…nt-manager's configuration With a remote target the agent-platform chart's components run on the target cluster while their HelmReleases stay on the management cluster, so agent-manager cannot read the default agent's release and refused every default-agent session. muster.toolApproval.platformAgents (flag --approval-platform-agents) now carries such an agent's release and its approval values (tools, toolset, default, muster.requireApproval), rendered by the agent-platform chart from the values it renders the release with. A session of such an agent binds those values without reading the release and without grants; it is refused when the Agent is unreadable or its Flux labels name another release, or when its RemoteMCPServer is unreadable or its X-Muster-Tool-Approval header carries other settings. Entries are validated strictly at startup and by the chart.
…t or agent-manager created it An Agent's Flux labels are editable by whoever may edit the Agent, so they no longer decide which release's tool approval settings a Session binds. Platform-rendered agents (muster.toolApproval.platformReleases, now agent -> release) bind their listed release only and are refused with other or missing labels; any other agent binds only the release agent-manager creates for it (its namespace, its name).
Review recordPart of giantswarm/giantswarm#38902 (tool approval, milestones 1 to 3). Purpose: this record says what was reviewed on this branch (the chart's per-tool approval defaults; approval settings, grants and split update tools on agents; the 2.x to 3.x migrate hop), by whom and with which outcome, so that reviewers can skip what is covered. Branch Read this first
Review rounds
What was checked
FindingsChart (milestone 1)
Slice 3 (agent approval settings and grants), findings that changed this repository
Slice 8 (migrate hop), findings that changed this repository
Final reviews: delta review, re-checks, default agent and last review (findings for this repository)
Lab verification
Default agent check (image of
The refused-start conflict and the portal's key rotation are covered by unit tests. Never run: the remote-target path ( Open itemsFindings still open or partly fixed:
Never run:
|
Review record — updatePart of giantswarm/giantswarm#38902. Covers only what is new since the record above (tip Read this first
Review rounds
Open items
|
Review supplement for giantswarm/giantswarm#38902Reviewed head: SpecConcurrent start/save must never retain a dropped grant. The failed final-read path violates that explicit PRD contract; independent refutation found no later guaranteed repair. This is a scoped contract assessment, not an exhaustive numbered acceptance score. Independent focused specification cross-checks covered the core enforcement/client contracts and platform/manager integration. Declared follow-ups and accepted design changes are not counted as new defects. Blocking
Each blocking finding survived an independent attempt to disprove its reachable path and existing guards. Non-blockingNone newly established. SuggestionsNone beyond the existing review follow-ups. Deep verification
Reported checks passed or were skipped; no failed/cancelled check to triage. A skipped job is not evidence that its gate ran. Unverified locally: applicable builds, tests (including race/integration/envtest), vet, formatting/lint/pre-commit, generators, Makefile verification targets, Helm rendering/schema/unit checks, and browser/live-cluster flows. No PR code was executed. GitHub-reported CI provides supporting evidence, not a local reproduction. Large test, fixture and documentation changes were inspected selectively; this is a focused deep review of the contracts above, not exhaustive line-by-line coverage. Recommendation: changes required. Team context: none. |
A2A and cross-repository design follow-upReviewed The pinned a2a-go/v2 v2.9.0 identifies protocol 1.0. Against A2A v1.0.0, existing version service parameters and task/context continuation are consistent with the examined contracts. Arbitrary A2A-client interoperability is not complete: giantswarm/giantswarm#39569 explicitly records that a session created directly through the A2A edge lacks the muster binding and its first tool call is Unauthorized. This is a deferred integration gap, not a demonstrated approval bypass or, by itself, a violation of the spec's optional context-creation behavior. Do not claim all A2A clients can start usable sessions until its acceptance criteria are met. Non-blocking: give the three chart-major classifiers one explicit contract. The Go classifiers in agent-manager and operator, and the Helm helper, duplicate finite-probe range classification with different limits. For The split of manager-owned grants, muster-owned enforcement and platform-managed release policy is appropriate. Keeping response Verification: static source and published-spec review only; no PR code executed. Local builds, tests/race tests, lint, Helm gates, browser flows and independent-client interoperability remain unverified. Heads were rechecked unchanged. This supplements the earlier deep-review verdict and does not clear its blockers. |
A start bound with a grant a concurrent save dropped kept it when the final grants read failed or the pending mark kept conflicting. The recheck now answers an error and the start unbinds and abandons the session.
Document the range grammar migrate reads and refuse a range that names or admits a chart major of 100 or more instead of reading its majors short, as the operator and the agent-platform chart do.
A range bounded below 100.0.0 names major 100 without admitting it and stays supported.
…zation ready mark The agent-platform-operator can then hold an organization's chart source when a release was recreated under the same name or its spec changed after the run.
Review record — Quentin's reviewPart of giantswarm/giantswarm#38902. Answers the review of 2026-11-27 (comments below). Branch
Independent re-checkClaude Fable, 2026-11-28, detached worktree at
Open items
|
|
@QuentinBisson thanks for the thorough review (your comment). Addressed: QB-03 fixed in Details and the independent re-check are in the review record. |
Main dropped internal/identity for mcp-oauth's UserInfo: the approval code uses agents.RequestedBy/UserAttr and idtoken, the caller-kind mark moves to the agents package (attachCallerKind in the OAuth chain) and an approval grant's grantedBy reads EmailVerified from the UserInfo. The split update tools, set_agent_approval and list_approval_grants address an organization's agents by its name like main's other agent tools. mustermcp's meta-tool session relays URL elicitations for every call.
Review record — merge roundPart of giantswarm/giantswarm#38902. Reviewer: Claude Fable 5.2, independent of the implementing and merging model, read-only, verdicts formed from the code. Full review: Covers the merge of main
Run: |
Review record — merge of main before releaseMerge
|
Part of giantswarm/giantswarm#38902. The review record is the first comment on this PR, with an update comment for the later work and a record of the review round of 2026-11-27 (Quentin).
What does this PR do?
muster now decides Allow, Ask or Block for every tool call (giantswarm/muster, linked below). This PR is agent-manager's part of it.
muster.mcpServer.approvalrendersspec.approvalon the musterMCPServerwithrule: Allowand one entry per tool (34 tools, allAllow, the same effect as today; includesupdate_agent_access,set_agent_approvalandlist_approval_grants).approval: nullclears it;{}does not (Helm merges). A Go drift test compares the map with the server's registered tools.toolsmap each tool toAllow,AskorBlock, anddefault(AskorBlock) covers the rest.get_agentreportstoolSettings,defaultApproval,grants,approvalSettings,approvalEnforcedandgeneration;get_agent'stoolskeeps its meaning (new data is under new fields).update_agenttakes only descriptive fields; the tool list, skills, plugins, egress, connectors, Harness, toolchains andrefreshSkillsgo toupdate_agent_access, the settings anddefaulttoset_agent_approval. Writes takeexpectedGenerationand refuse a stale one. The chart pickstoolsortoolsetby the target release's chart and warns instead of failing.set_agent_approval, checked against muster'sfilter_tools). Grants are agent-manager's own records: a ConfigMap per agent in a grants namespace of its own (internal/approvalgrants), read withlist_approval_grants. A save by anyone else, an agent's deletion and a rebuilt connector drop them; revocation is retried durably and reaches running Sessions. A grant never lifts a floor or the governed default.start_sessionsends the agent's settings,defaultand grants to muster's session bindings API with agent-manager's own projected ServiceAccount token (audiencemuster) beside the person's. Bindings sender-written can't be overwritten without the sender. On by default (muster.toolApproval.enabled); while off agent-manager refuses settings and the sessions of agents that carry them (fail closed). The bindings URL can be https with its own CA (muster.bindingsCA).agent-manager migrategets the hop that rewritesmuster.requireApprovaltodefault: Askbefore the agent chart's line moves to 3.0. It reads everything before writing, never writes values it cannot follow, and holds a source's releases behind a sibling's diff: a GitOps release gets a diff, never a write; avaluesFromrelease is reported, never overwritten; organization namespaces are covered: the releases migrate owns are rewritten by the managed rules (GitOps ones get the diff and hold their siblings), the report is written in every organization namespace (also for sources on another registry, found by chart name) and an organization is marked ready, naming the releases the mark covers, once every release there is on 3.x values; the operator moves the source on that mark only; next-major pre-releases and ranges that span majors are refused; re-running is a no-op. An agent withrequireApprovalis bound withdefault: Askalready on 2.x.muster.toolApproval.platformReleases, release to Agent; a Role grantsgetby name): such an agent binds only that release and is refused with other or missing labels; any other agent accepts a labelled release only in its own namespace under its own name. For an agent whose release is on another cluster the settings come from agent-manager's own configuration (platformAgents); the live objects can only refuse. A start refused after kagent made its Session answers aconflictthat names a new request id.docs/tool-approval.md,docs/tools.md,api/openapi.yaml, README.Commits: milestone 1
9576419,65ec338,38af12f,b4ca50d,1ac78a6(chart default, Block rule, README, drift test); milestone 233e414d..b107856,e437dbb(grants, settings, split tools, session sync, fail-closed fixes); milestone 3e12845b..d7e8044,a56072e,9396637,0356597(migrate hop, its fix rounds, organization releases and the ready mark);fdae6d1,984f2d8,c1d8abb,cd3b3a1(release lookup, platform releases, remote target, the labels check); after milestone 3:04af9ca(normalizevalues.schema.json),9f903f4(the display name in the binding),dec1567(docs condensed); review round of 2026-11-27:355df4b(grant recheck fails closed),d244752,48ed659(range limit),2f67c08(UID and generation in the ready mark),b6240d0(docs link). Tip2f67c08.What is the effect of this change to users?
Allow, as before.update_agentthat send the tool list, skills, plugins and so on get a refusal that names the tool to use (update_agent_access).muster.requireApprovalkeep asking: the migrate hop moves them todefault: Askahead of the chart 3.0 (see the agent chart's PR).How does it look like?
Not a visual change. Rendered
MCPServer:set_agent_approvalas a connector admin, withget_infoAsk on the connector: the answer carries the grant{entry, server, connectorUid, grantedBy, generation, tools: [get_info]}.Changes from the plan
Where this PR differs from the design in the epic (giantswarm/giantswarm#38902):
muster.mcpServer.approvalacceptsrule: Blockas well.X-Muster-Tool-Approvalas well as binding them; agent-manager's binding is on by default, and it refuses settings and session starts where it can bind none, instead of rendering nothing.toolsortoolset. agent-manager writestoolsor the deprecatedtoolsetby the target chart's schema and refuses settings for a chart withouttools, so agents on older chart lines keep working.get_agentandlist_agentskeeptoolsas the kagent bindings; the list istoolSettingswithdefaultApproval,grants,approvalSettings,approvalEnforcedandgeneration. Update tools takeexpectedGeneration.list_approval_grants; a grant names the tools it covered, and a tool that asks later isn't lifted.update_agent_accessaccepts an unchanged carried-overAllowover anAsk(the save drops its grant unless the saver is a connector admin). An agent'sset_agent_approvalrecords the grants its own call names and drops the rest.PATCH /session-bindings/grants, retried until it lands, instead of through a bind.muster.requireApproval: trueis bound withdefault: Askalready on 2.x, so it is asked by kagent and by muster until migrate rewrites it. The hop also writesmodelConfig.namewhen unset, holds (with a diff) a release whose source is pinned, git-owned, external or an organization's, reports avaluesFromrelease without writing it, and covers organization namespaces with a ready mark that the operator waits for.agentChartV3Floor) are unset until real releases exist.Any background context you can provide?
spec.approvaland, for settings and grants, a muster that takes an agent's approval settings (muster's PR). Against an older muster agent-manager binds agents without settings as before and refuses the sessions of agents with settings. After muster's CRD upgrade, force-reconcile the release (flux reconcile helmrelease <name> -n <ns> --force) if it was applied while the old CRD was served.:8091); agent-manager'smuster.bindingsUrlnames it. The agent-platform chart renders both.valuesFromrelease already on 3.x isunchangedwith a warning, because migrate cannot see whetherrequireApprovalbecamedefault: Askor was deleted (chart 3.x refuses the key); on agent chart 2.x, which renders noX-Muster-Tool-Approvalheader, a Session binds the older configuration until agent-manager rolls out after a release change.Related pull requests (milestones 1 to 3)
What is needed from the reviewers?
trustedplatform.cd3b3a1, not re-checked). The display name (9f903f4) was covered by the last check (second model; update comment in the review record);dec1567(docs) and04af9ca(schema formatting) were not independently re-checked. Open findings are minor and listed in the record.Do the docs need to be updated?
Done:
docs/tool-approval.md,docs/tools.md,api/openapi.yaml, the chart README rows.Testing
helm lint,helm templatedefault,approval=null,rule=Block,rule=Deny,tools.bogus=maybeBlockrenders; the others refused by the schema, naming the pathinternal/api/helm_approval_test.gocompares them; passed in the first lab re-test, CI runs itinternal/...)lab-tests/m2-integration.md), agent-managerb107856create_agentwithtools; Session binds the list (Block hidden); grants granted by a connector admin and refused for a non-admin; floors and the governed Ask never lifted;list_approval_grants; saving clears and revokes in running Sessions;delete_agentcleans up; stale writes refused (conflict); binding integrity;requireApprovalpath through a2a;platform-testpassed. Defects (M2I-2..5, M2I-8) fixed or decided in the review round; R-02 (a Session start in an organization namespace) not re-checkedlab-tests/m3-integration.md), agent-manager6f81a3brequireApprovalagents rewritten todefault: Askand ask through muster before and after; a running Session asks across the upgrade; a GitOps agent gets a diff and is never written; re-running is a no-op; refused ranges;platform-test17 PASS. Defects M3I-2 and M3I-3 (a held release rewritten while its source stays on 2.x; an organization source on another registry skipped) fixed in396abc4andfe1fa5b; M3I-1 is the dry run's RBAC (agent-platform)lab-tests/default-agent-fix.md), agent-manager984f2d8default: Askis bound and a tool call asks; cleaned upgo build,go vet,go test ./internal/... ./cmd/...,helm lint; 32 + 12 + 6 + 22 mutants over four passes; two PoCs reproduced L-01 before its fixDisplay name (2026-11-26): lab final rollout at
9f903f4(the prompt reads " wants to run …" and the portal view carries the name); last check:go build,go vet,go test ./internal/...pass, 3 mutants (1 killed, 2 survived without a test, LC-15). Not run: the remote-target path (c1d8abb, never in a cluster: the lab has no remote target), Flux's remediation of organization releases that fail chart 3.0's schema,helm unittest(not installed on the reviewers' machine; the suites added forplatformReleasesandplatformAgentswere not executed), thevaluesFromcase in a lab (admission refuses it there; unit-tested), a real operator move of an organization's source (M2I-1 in the lab; fixed in agent-platform-operator, linked below).Review round 2026-11-28 (
355df4b..2f67c08): regression test for the failed recheck, tests for the version-bound mark and the range limit;internal/agentsandinternal/migratepass in the independent re-check (envtest not run there). See "Review record — Quentin's review".